<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
       <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="f"%>
<%@page import="java.util.List"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>就业管理系统</title>
		<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/layui-v2.6.13/layui/css/layui.css" />
		<script type="text/javascript" src="${pageContext.request.contextPath}/layui-v2.6.13/layui/layui.js"></script>
		<script type="text/javascript" type="text/css"  src="${pageContext.request.contextPath}/js/jquery.min-2.1.1.js"></script>
	</head>
	
	<body>
		<div class="layui-layout-admin">
			<div class="layui-header">
				<div class="layui-logo">就业管理系统</div>
				<ul class="layui-nav layui-layout-right">
					<li class="layui-nav-item">
						<a href=""><img src="${pageContext.request.contextPath}/img/4.png" class="layui-nav-img">于智伟</a>
						<dl class="layui-nav-child">
							<dd><a href="">基本资料</a></dd>
							<dd><a href="">安全设置</a></dd>
						</dl>
					</li>
				</ul>
			</div>

			<style>
				.iconset {
					margin-right: 5px;
				}
			</style>
			<!--左侧-->
			<div class="layui-side layui-bg-black">
				<div class="layui-side-scroll">
					<ul class="layui-nav layui-nav-tree layui-inline" lay-filter="demo" style="margin-right: 10px;">
						<li class="layui-nav-item layui-nav-itemed">
							<a href="javascript:;"><i class="layui-icon layui-icon-set iconset"></i>管理系统</a>
							<dl class="layui-nav-child">
								<dd><a href="javascript:; data-type="toAdd" class="subMenu" data-id="1"
										data-title="学生管理" data-url="s?m=listPage"><i
											class="iconfont  icon-yonghu iconset"></i>学生管理</a></dd>
								<dd><a href="javascript:;" data-type="toAdd" class="subMenu" data-id="2"
										data-title="学院管理" data-url="c?m=academySelect"><i
											class="iconfont  icon-ziyuan iconset"></i>学院管理</a></dd>
								<dd><a href="javascript:;" data-type="toAdd" class="subMenu" data-id="3"
										data-title="专业管理" data-url="major?m=majorSelect"><i
											class="iconfont  icon-ziyuan iconset"></i>专业管理</a></dd>
							</dl>
						</li>
						<li class="layui-nav-item layui-nav-itemed">
							<a href="javascript:;"><i class="iconfont  icon-choujiang iconset"></i>解决方案</a>
							<dl class="layui-nav-child">
								<dd><a href="javascript:;" data-type="toAdd" class="subMenu" data-id="4"
										data-title="解决方案" data-url="">
										<i class="iconfont  icon-jiangpin iconset"></i>解决方案</a></dd>

							</dl>
						</li>
					</ul>
				</div>
			</div>

			<div class="layui-body" id="container">
				<div class="layui-tab" lay-filter="tabs" lay-allowClose="true">
					<ul class="layui-tab-title"></ul>
					<div class="layui-tab-content">
					</div>
				</div>
			</div>

			<div class="layui-footer">
			</div>
		</div>
		<script>
			layui.use(['element'], function() {
				var element = layui.element;
				var $ = layui.$;
				$('.subMenu').on('click', function() {
					var dataid = $(this);
					if ($(".layui-tab-title li[lay-id]").length <= 0) {
						active.tabAdd(dataid.attr("data-url"), dataid.attr("data-id"), dataid.attr(
						"data-title"));
					} else {
						var isData = false;
						$.each($(".layui-tab-title li[lay-id]"), function() {
							if ($(this).attr("lay-id") == dataid.attr("data-id")) {
								isData = true;
							}
						})
						if (isData == false) {
							active.tabAdd(dataid.attr("data-url"), dataid.attr("data-id"), dataid.attr(
								"data-title"));
						}
					}
					active.tabChange(dataid.attr("data-id"));
				});

				var active = {
					tabAdd: function(url, id, name) {
						element.tabAdd('tabs', {
							title: name,
							content: '<iframe data-frameid="' + id +
								'" scrolling="auto" frameborder="0" src="' + url +
								'" style="width:100%;height:99%;"></iframe>',
							id: id
						})
						FrameWH();
					},
					tabChange: function(id) {
						element.tabChange('tabs', id);
					},
					tabDelete: function(id) {
						element.tabDelete("tabs", id);
					}
				};

				function FrameWH() {
					var h = $(window).height();
					$("iframe").css("height", h + "px");
				}
			});
		</script>
	</body>
</html>
